# apps/weibo/strategies.py
from utils.base_strategies import DeleteStrategy
from .models import WeiboNote, WeiboNoteComment

class WeiboDeleteStrategy(DeleteStrategy):
    def delete_content(self, task_id):
        WeiboNote.objects.filter(task_id=task_id).delete()

    def delete_comments(self, task_id):
        content_ids = WeiboNote.objects.filter(task_id=task_id).values_list('note_id', flat=True)
        WeiboNoteComment.objects.filter(note_id__in=content_ids).delete()